examples: Add common_cflags to build
authorTimm Bäder <mail@baedert.org>
Fri, 6 Mar 2020 15:36:42 +0000 (16:36 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 6 Mar 2020 15:36:42 +0000 (16:36 +0100)
And fix all the warnings and errors generated by doing so.

See #2491

examples/meson.build
examples/plugman.c
examples/sunny.c

index b5c28634eab37ba839f4355fdd7f7265d7644add..8fcc04d5479095db00c5052c85edce924b6f9e30 100644 (file)
@@ -17,7 +17,7 @@ foreach ex : examples
                '-DGDK_DISABLE_DEPRECATED',
                '-DGTK_DISABLE_DEPRECATED',
                '-DGTK_SRCDIR="@0@"'.format(meson.current_source_dir()),
-             ],
+             ] + common_cflags,
              dependencies: libgtk_dep)
 endforeach
 
index 67d7960c5dda057432472643e1f75973f8b4f4fe..d36b28bfb145387b6be18fe7a93f227a1d76347a 100644 (file)
@@ -135,6 +135,7 @@ plug_man_open (GApplication  *application,
 typedef GtkApplication PlugMan;
 typedef GtkApplicationClass PlugManClass;
 
+static GType plug_man_get_type (void);
 G_DEFINE_TYPE (PlugMan, plug_man, GTK_TYPE_APPLICATION)
 
 static void
@@ -376,10 +377,10 @@ configure_plugins (GSimpleAction *action,
   dialog = (GtkWidget *)gtk_builder_get_object (builder, "plugin-dialog");
   check = (GtkWidget *)gtk_builder_get_object (builder, "red-plugin");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("red"));
-  g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), "red");
+  g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "red");
   check = (GtkWidget *)gtk_builder_get_object (builder, "black-plugin");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), plugin_enabled ("black"));
-  g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), "black");
+  g_signal_connect (check, "toggled", G_CALLBACK (enable_or_disable_plugin), (char *) "black");
 
   g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
 
@@ -481,7 +482,7 @@ plug_man_class_init (PlugManClass *class)
 
 }
 
-PlugMan *
+static PlugMan *
 plug_man_new (void)
 {
   return g_object_new (plug_man_get_type (),
index e57e9edd80487b81d6b98fad31b8d8b4499101ef..3e3fc6a672bfca61b5caa6f46fafe3d98cffeaf5 100644 (file)
@@ -70,6 +70,7 @@ open (GApplication  *application,
 typedef GtkApplication MenuButton;
 typedef GtkApplicationClass MenuButtonClass;
 
+static GType menu_button_get_type (void);
 G_DEFINE_TYPE (MenuButton, menu_button, GTK_TYPE_APPLICATION)
 
 static void
@@ -176,7 +177,7 @@ menu_button_class_init (MenuButtonClass *class)
   application_class->open = open;
 }
 
-MenuButton *
+static MenuButton *
 menu_button_new (void)
 {
   return g_object_new (menu_button_get_type (),